#pragma once
/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * Connection Request Event Arguments Class
 *      An event arguments class for new connection request events.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
#include "stdafx.h"
#include "ConnectionEventArgs.h"

using namespace System;

namespace Adaptive
{
	namespace Network
	{
		namespace Sockets
		{
			/// <summary>
			/// An event arguments class for new connection request events.
			/// </summary>
			/// <remarks>
			/// This is used with events where connection object instances are passed, such as 
			/// new connection events, allowing the reciever of the event to cancel the 
			/// connection if desired.
			/// </remarks>
			public ref class ConnectionRequestEventArgs : public ConnectionEventArgs
			{
			public:
				/*--------------------------------------------------------------------------------
				 * Constructor / Dispose / Destructor Methods
				 *------------------------------------------------------------------------------*/
				#pragma region Constructor / Dispose / Destructor Methods
				/// <summary>
				/// Initializes a new instance of the class.
				/// </summary>
				/// <param name="newSocket">
				/// The newly connection <see cref="ISocketConnection"/> instance.
				/// </param>
				ConnectionRequestEventArgs(ISocketConnection^ newSocket);
				/// <summary>
				/// Class destructor.
				/// </summary>
				~ConnectionRequestEventArgs();
				#pragma endregion
				
				/*--------------------------------------------------------------------------------
				 * Public Properties
				 *------------------------------------------------------------------------------*/
				#pragma region Public Properties
				/// <summary>
				/// Gets or sets a value indicating whether the remote connection is to be allowed.
				/// </summary>
				/// <value>
				/// <b>true</b> to allow the connection; otherwise, <b>false</b>.
				/// </value>
				property bool Allow { bool get(); void set( bool value ); }
				#pragma endregion

			private:
				/*--------------------------------------------------------------------------------
				 * Private Member Declarations
				 *------------------------------------------------------------------------------*/
				#pragma region Private Member Declarations

				bool		_allow;

				#pragma endregion

			};
		}
	}
}
